<SCRIPT LANGUAGE="JavaScript">  
    function validation()
    {
        var temp="";
        var emailPattern = /^\w+@\w+(\.\w{2,3})+(\.\w{2,3})?$/;


        temp=document.getElementById('JobseekerFirstName').value;
        if( temp.length==0 )
        {
            document.getElementById('JobseekerFirstName').focus();
            document.getElementById('JobseekerFirstName').style.backgroundColor='#FFC';
            alert("Please fill your first name");
            document.getElementById('JobseekerFirstName').style.backgroundColor='#FFF';
            return false;             
        }
                
        temp=document.getElementById('JobseekerEmail').value;
        if( !emailPattern.test(temp) )
        {
            document.getElementById('JobseekerEmail').focus();
            document.getElementById('JobseekerEmail').style.backgroundColor='#FFC';
            alert('Please enter a valid email');
            document.getElementById('JobseekerEmail').style.backgroundColor='#FFF';
            return false;             
        }     
        
        if( temp != document.getElementById('email').value )
        {
            return confirm('Anda telah mengubah email Anda, sehingga Anda harus memverifikasi email Anda lagi. \n Are you sure ?');
        }    
        
    }
    

</SCRIPT>
    
<?php 
echo "<div class='form'>";
    echo "<h2> Edit Acount </h2>";
    echo "<hr color='#2A7EF7'>";
    echo "<div class='kotak2'>"; 
        
        echo $form->create('Jobseeker',array('action'=>'edit_account','onsubmit'=>'return validation();'));
            echo "<input type='hidden' id='email' name='data[oldemail]' value='".$this->data['Jobseeker']['email']."'>";
            echo $form->input('email', array ('maxLength'=>'40','after'=>"<span class='red'><sup>*</sup></span>"));          
            echo "<div class='input'><label for='UserField'>Password</label>"; 
            echo $html->link(__('[ Change Password ]', true), array('action'=>'change_password'));                                 
            echo "</div>";
            echo $form->input('first_name',array ('maxLength'=>'20','after'=>"<span class='red'><sup>*</sup></span>"));
            echo $form->input('last_name',array ('Family/Last Name','maxLength'=>'20'));
            
        echo $form->end('Save');
    echo "</div>";
    echo ":. <span class='red'>*</span> Required Field";
    echo "<br>:. <span class='red'>Warning!!!</span> Jika Anda mengubah email Anda, Anda harus memverifikasi email Anda lagi dan Anda akan logout";

echo "</div>";

?>



